from aiogram.filters.callback_data import CallbackData
from aiogram.types import InlineKeyboardMarkup
from aiogram.utils.keyboard import InlineKeyboardBuilder
from fluentogram import TranslatorRunner


class CalendarTaskCF(CallbackData, prefix="calendartask"):
    user_calendar_id: int


def calendar_task_feedback_kb(
    locale: TranslatorRunner,
    user_calendar_id: int,
) -> InlineKeyboardMarkup:
    builder = InlineKeyboardBuilder()
    builder.button(
        text=locale.get("task-succeed-btn"),
        callback_data=CalendarTaskCF(user_calendar_id=user_calendar_id),
    )
    builder.button(
        text=locale.get("task-failed-btn"),
        callback_data=CalendarTaskCF(user_calendar_id=user_calendar_id),
    )

    builder.adjust(1)

    return builder.as_markup()
